<?php
namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Overtrue\EasySms\EasySms;

class EasySmsServiceProvider extends ServiceProvider {
    public function boot() {
    }
    public function register() {
        $this->app->singleton(EasySms::class, function ($app) {
            return new EasySms(config('easysms'));
        });

        $this->app->alias(EasySms::class, 'easysms');
    }
}
// $sms = app('easysms');
// try {
//     $sms->send(17612737668, [
//         'content'  => '【壹加壹】您的验证码是1234。如非本人操作，请忽略本短信',
//     ]);
// } catch (\GuzzleHttp\Exception\ClientException $exception) {
//     $response = $exception->getResponse();
//     $result = json_decode($response->getBody()->getContents(), true);
//     dd($result);
// }